//
//  WPPEFFirstTableViewCell.m
//  wobingwoyi
//
//  Created by WGP on 2017/3/2.
//  Copyright © 2017年 WGP. All rights reserved.
//

#import "WPPEFFirstTableViewCell.h"

@interface WPPEFFirstTableViewCell ()

@end

@implementation WPPEFFirstTableViewCell

-(instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier
{
    if (self = [super initWithStyle:style reuseIdentifier:reuseIdentifier])
    {
        [self titleField];
        [self textView];
    }
    return self;
}

-(UITextField *)titleField
{
    if (_titleField == nil)
    {
        _titleField = [UITextField new];
        _titleField.placeholder = @"请输入标题";
        _titleField.font = [UIFont systemFontOfSize:15];
        _titleField.textColor = GLobalFontColor;
        [self.contentView addSubview:_titleField];
        [_titleField mas_makeConstraints:^(MASConstraintMaker *make) {
            make.left.equalTo(self.contentView).offset(10);
            make.top.right.equalTo(self.contentView);
            make.height.mas_equalTo(44);
        }];
    }
    return _titleField;
}

-(WPMinePlaceholderTextView *)textView
{
    if (_textView == nil)
    {
        UIImageView *line = [UIImageView lineImageView];
        [self.contentView addSubview:line];
        [line mas_makeConstraints:^(MASConstraintMaker *make) {
            make.left.equalTo(self.titleField);
            make.right.equalTo(self.contentView);
            make.height.mas_equalTo(0.5);
            make.top.equalTo(self.contentView).offset(43);
        }];
        
        _textView = [WPMinePlaceholderTextView new];
        _textView.placeholder = @"填写您对于体检报告的说明";
        _textView.font  = [UIFont systemFontOfSize:14];
        _textView.textColor = GLobalFontColor;
        [self.contentView addSubview:_textView];
        [_textView mas_makeConstraints:^(MASConstraintMaker *make) {
            make.left.equalTo(self.contentView).offset(10);
            make.right.equalTo(self.contentView).offset(-10);
            make.top.equalTo(self.titleField.mas_bottom);
            make.bottom.equalTo(self.contentView);
        }];
    }
    return _textView;
}

@end
